package com.holly.unit.bpmn.modular.activiti.controller;

import com.holly.unit.bpmn.activiti.ActivitiOperator;
import com.holly.unit.bpmn.activiti.pojo.ActiviExpressionRequest;
import com.holly.unit.core.pojo.response.ResponseData;
import com.holly.unit.core.pojo.response.SuccessResponseData;
import com.holly.unit.scanner.api.annotation.ApiResource;
import com.holly.unit.scanner.api.annotation.GetResource;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@ApiResource(name = "流程模型表达式设置")
@Api(tags = "流程模型表达式设置")
@RequestMapping("/activiti/expression")
@Slf4j
public class ActivitNodeController {

    @Resource
    private ActivitiOperator operator;

    /**
     * 根据节点Id查询表达式
     * @author holly
     * @date 2022-03-21 02:44:34
     */
    @ApiOperation(value = "根据节点Id查询表达式" ,notes = "根据节点Id查询表达式")
    @GetResource(name = "根据节点Id查询表达式", path = "/getExpression")
    public ResponseData getExpression(ActiviExpressionRequest activiExpressionRequest) {
        return new SuccessResponseData(operator.getExpression(activiExpressionRequest));
    }

}
